<div id="box-forum-groups">
    <div class="group-name"><?php echo ($this->forumGroup['title']); ?></div>
	<table class="group-forum" cellpadding="0" cellspacing="0">
        <thead>
            <tr>
            <th class="group-name">Форуми</th>
            <th class="group-title">Теми</th>
            <th class="group-mesage">Повідомлення</th>
            <th class="group-lastmesage">Останнє повідомлення</th>
            </tr>
        </thead>
    <?php if (isset($this->forumGroup['id'])) { ?>
        <tbody>
        <?php foreach($this->forums as $forum){ ?>
            <tr>
            	<td class="group-name"><a href="<?php echo $this->url()->getUrl('view/forum/?id='.$forum['id']) ?>"><?php echo $forum['title']?></a><br/><?php if (trim($forum['description']) != '') : ?><span class="description" ><?php echo $forum['description'] ?></span><?php endif; ?></td>
    			<td class="group-title"><?php echo isset($this->ForumThreads[$forum['id']]) ? $this->ForumThreads[$forum['id']] : '--' ?></td>
    			<td class="group-mesage"><?php echo (isset($this->ForumMessages[$forum['id']]))?$this->ForumMessages[$forum['id']]:"0"  ?></td>
    			<td class="group-lastmesage"><?php  if(isset($this->ForumMessages[$forum['id']])){
    													if(isset($this->users[$this->forumLastMessages[$forum['id']]['user_id']])){
    														echo $this->users[$this->forumLastMessages[$forum['id']]['user_id']]['username'];
    													}else{
    														echo "привидение :)";
    													}
    												 }else{
    												 	echo "--";
													 } ?><br/>
											<?php if(isset($this->ForumMessages[$forum['id']])){
														?><span class="date"><?php echo $this->date()->format($this->forumLastMessages[$forum['id']]['date']) ?></span><?php
												  }?></td>
            </tr>		
        <?php }  ?>
        </tbody>
    <?php } ?>
	</table>
</div>